// component.h
#ifndef COMPONENT_H
#define COMPONENT_H

#include <QObject>
#include <QString>
#include <QIcon>
#include <QList>
#include <QPointF>
#include <QMetaType>

class Component
{
public:
    enum Type {
        Wire,
        Connector,
        Passive,
        Semiconductor,
        Power,
        Measurement,
        Custom
    };

    Component(const QString &name = QString(),
              const QString &iconPath = QString(),
              Type type = Custom,
              const QString &description = QString());
    Component(const Component &other);

    QString name() const;
    void setName(const QString &name);

    QIcon icon() const;
    void setIcon(const QString &path);
    void setIcon(const QIcon &icon);

    Type type() const;
    QString typeString() const;
    void setType(Type type);

    QString description() const;
    void setDescription(const QString &description);

    QString value() const;
    void setValue(const QString &value);

    QList<QPointF> connectionPoints() const;
    void addConnectionPoint(const QPointF &point);

private:
    QString m_name;
    QIcon m_icon;
    Type m_type;
    QString m_description;
    QString m_value;
    QList<QPointF> m_connectionPoints;
};

Q_DECLARE_METATYPE(Component*)

#endif // COMPONENT_H
